package com.cscj.android.repository.db.entity

import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity("search_engine")
data class SearchEngineEntity(
    @PrimaryKey(autoGenerate = true) val id: Int = 0,
    val name: String,
    val icon: String? = null, //image based 64
    val urlPattern: String,
    val preferred: Boolean = false
) {

    fun getUrl(query: String): String {
        return urlPattern + query
    }
}
